package com.xukang.batch.listener;

import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.StepExecutionListener;

/**
 * 监听Step执行，动态设置时间戳
 */
public class MyStepListener implements StepExecutionListener {


    public MyStepListener() {

    }

    @Override
    public void beforeStep(StepExecution stepExecution) {
        System.out.println("beforeStep");
        System.out.println("currentThread:" + Thread.currentThread().getId());
        System.out.println("stepExecution:" + stepExecution);
    }

    @Override
    public ExitStatus afterStep(StepExecution stepExecution) {
        System.out.println("afterStep");
        System.out.println("currentThread:" + Thread.currentThread().getId());
        System.out.println("stepExecution:" + stepExecution);
        return null;
    }

}
